<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: AESCounterBase Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_a_e_s_counter_base.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_a_e_s_counter_base-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">AESCounterBase Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Base class for AESCounter&lt;S&gt;.  
 <a href="class_a_e_s_counter_base.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="apps_2elftosb_2common_2_a_e_s_counter_8h_source.html">AESCounter.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for AESCounterBase:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="class_a_e_s_counter_base__inherit__graph.svg" width="302" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:acfea7055ca20fc658ee9616b55e970f2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_e_s_counter_base.html#acfea7055ca20fc658ee9616b55e970f2">_readFromStream</a> (std::istream &amp;stream, unsigned bytes, uint8_t *buffer)</td></tr>
<tr class="memdesc:acfea7055ca20fc658ee9616b55e970f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads hex encoded data from <em>stream</em>.  <a href="#acfea7055ca20fc658ee9616b55e970f2">More...</a><br /></td></tr>
<tr class="separator:acfea7055ca20fc658ee9616b55e970f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfaa4964e03622a762b8a5886069e5bd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_e_s_counter_base.html#adfaa4964e03622a762b8a5886069e5bd">_writeToStream</a> (std::ostream &amp;stream, unsigned bytes, const uint8_t *buffer) const </td></tr>
<tr class="memdesc:adfaa4964e03622a762b8a5886069e5bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes hex encoded data to <em>stream</em>.  <a href="#adfaa4964e03622a762b8a5886069e5bd">More...</a><br /></td></tr>
<tr class="separator:adfaa4964e03622a762b8a5886069e5bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfea7055ca20fc658ee9616b55e970f2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acfea7055ca20fc658ee9616b55e970f2"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_e_s_counter_base.html#acfea7055ca20fc658ee9616b55e970f2">_readFromStream</a> (std::istream &amp;stream, unsigned bytes, uint8_t *buffer)</td></tr>
<tr class="memdesc:acfea7055ca20fc658ee9616b55e970f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads hex encoded data from <em>stream</em>. <br /></td></tr>
<tr class="separator:acfea7055ca20fc658ee9616b55e970f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfaa4964e03622a762b8a5886069e5bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adfaa4964e03622a762b8a5886069e5bd"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_e_s_counter_base.html#adfaa4964e03622a762b8a5886069e5bd">_writeToStream</a> (std::ostream &amp;stream, unsigned bytes, const uint8_t *buffer) const </td></tr>
<tr class="memdesc:adfaa4964e03622a762b8a5886069e5bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes hex encoded data to <em>stream</em>. <br /></td></tr>
<tr class="separator:adfaa4964e03622a762b8a5886069e5bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Base class for AESCounter&lt;S&gt;. </p>
<p>This class implements some bigger, non-template methods used in the AESCounter&lt;S&gt; templated subclass. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="acfea7055ca20fc658ee9616b55e970f2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AESCounterBase::_readFromStream </td>
          <td>(</td>
          <td class="paramtype">std::istream &amp;&#160;</td>
          <td class="paramname"><em>stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads hex encoded data from <em>stream</em>. </p>
<p>The data from the stream is expected to be hex encoded. Each two characters from the stream encode a single result byte. All non-hexadecimal characters are ignored, including newlines. Every two hexadecimal characters form an encoded byte. This is true even if the two characters representing the upper and lower nibbles are separated by whitespace or other characters.</p>
<dl class="section post"><dt>Postcondition</dt><dd>The stream read head is left pointing just after the last encoded byte.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">stream</td><td>Input stream to read from. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">bytes</td><td>Number of encoded bytes to read. This is the number of <em>result</em> bytes, not the count of bytes to read from the stream. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>Pointer to the buffer where decoded data is written.</td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::runtime_error</td><td>This exception will be thrown if less data than required is available from <em>stream</em>, or if some other error occurs while reading from <em>stream</em>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adfaa4964e03622a762b8a5886069e5bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AESCounterBase::_writeToStream </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Writes hex encoded data to <em>stream</em>. </p>
<p>Counter data is written to <em>stream</em> as a sequence of hex encoded octets, each two characters long. No spaces or newlines are inserted between the encoded octets or at the end of the sequence.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::runtime_error</td><td>Thrown if the <em>stream</em> reports an error while writing the key data. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="apps_2elftosb_2common_2_a_e_s_counter_8h_source.html">apps/elftosb/common/AESCounter.h</a></li>
<li>AESCounter.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_a_e_s_counter_base.html">AESCounterBase</a></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:50 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
